'use strict';

/**
 * @ngdoc directive
 * @name myAppApp.directive:appFooter
 * @description
 * # appFooter
 */
angular.module('jgappApp')
    .directive('appFooter', function() {
        return {
            template: '<div class="footer">' + '<div class="footer-menu flex tc">' +
                '<p class="talk msg"><a href="#/chat/index">聊天<span class="icon" ng-show="haveMsgs"></span></a></p>' +
                '<p class="home"><a href="#/index/index">工作</a></p>' +
                '<p class="work"><a href="#/work/index">应用</a></p>' +
                '<p class="user"><a href="#/user/setting">设置</a></p>' +
                '</div>' +
                '</div>',
            restrict: 'AE',
            replace: true,
            link: function postLink(scope, element, attrs) {
                // console.log(attrs.active)
                var className = "." + attrs.active;
                var element=element.children()[0].querySelector(className)
                element&&element.classList.add("active")
            }
        };
    });
